package com.org.config;

import com.org.interceptor.UserTokenInterceptor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
public class InterceptorConfiguration implements WebMvcConfigurer {

    @Autowired
    private UserTokenInterceptor userTokenInterceptor;

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(userTokenInterceptor)
                .addPathPatterns("/pc/**")
                .excludePathPatterns("/pc/user/user/login")
                .excludePathPatterns("/pc/user/user/registry")
                .excludePathPatterns("/pc/email/**")
                .excludePathPatterns("/pc/findRegion");
    }

}
